package exam.service.impl;

import exam.bean.MarkPoints;
import exam.dao.MarkPointDao;
import exam.service.IMarkPointService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class MarkPointServiceImpl  implements IMarkPointService {

    @Autowired
    MarkPointDao markPointDao;

    @Override
    public int insertInfo(MarkPoints markPoints) {
        return markPointDao.insertInfo(markPoints);
    }

    @Override
    public int deleteInfo(int id) {
        return markPointDao.deleteInfo(id);
    }

    @Override
    public int updateInfo(MarkPoints markPoints) {
        return markPointDao.updateInfo(markPoints);
    }

    @Override
    public List<MarkPoints> selectInfo() {
        return markPointDao.selectInfo(null);
    }

    @Override
    public MarkPoints selectInfoSingle(int id) {
        Map<String,Object> map = new HashMap<String,Object>();
        map.put("id",id);
        return markPointDao.selectInfo(map).get(0);
    }
}
